package base.template;

/**
 * @program: DesignPatterns
 * @description: 只实现display方法抽象类
 * @author: Mr.Dai
 * @create: 2018-04-28 16:12
 **/
public abstract class AbstractDisplay {

      public abstract void open();
      public abstract void print();
      public abstract void close();

    /**
     * 实现打印5次的方法
     */
    public void  display() {
        open();
        for (int i = 0; i < 5; i++) {
            print();
        }
        close();
    }
}
